//
//   PrefixHeader.h
//   iOS Object
//
//   Created by 保密 on 2019/6/26.
//   Copyright © 2019年 XiaoHaiBao. All rights reserved.
//

#ifndef PrefixHeader_h
#define PrefixHeader_h

#import "iOSObjectHeader.h"

/// 屏幕的宽
#define SCREEN_WIDTH   [UIScreen mainScreen].bounds.size.width
/// 屏幕的高
#define SCREENH_HEIGHT [UIScreen mainScreen].bounds.size.height

/// 随机颜色
#define RandomColor [UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:1.0]
/// 颜色
#define RGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
/// 颜色(带透明度)
#define RGBAColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(r)/255.0 blue:(r)/255.0 alpha:a]
/// clear背景颜色
#define ClearColor [UIColor clearColor]

/// 判断是否为iPhone
#define iS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
/// 判断是否为iPad
#define iS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
/// 判断是否为ipod
#define iS_IPOD ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"])

/// 字体
// 常规
#define Font_PingFang_SC(font) [UIFont fontWithName:@"PingFangSC-Regular" size:(font)]
// 细体
#define Font_PingFang_SC_Light(font) [UIFont fontWithName:@"PingFangSC-Light" size:(font)]
// 中黑
#define Font_PingFang_SC_Medium(font) [UIFont fontWithName:@"PingFangSC-Medium" size:(font)]
// 中粗
#define Font_PingFang_SC_Semibold(font) [UIFont fontWithName:@"PingFangSC-Semibold" size:(font)]

/// 获取系统版本
#define iOS_SYSTEM_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]

/// 宏定义
#ifndef weakify
#define weakify(o) __weak typeof(o)  weak##o = o;
#define strongify(o) __strong typeof(o) o = weak##o;
#endif

/// 判断是真机还是模拟器
#if TARGET_OS_IPHONE
/// iPhone Device
#endif
#if TARGET_IPHONE_SIMULATOR
/// iPhone Simulator
#endif

/// 沙盒目录文件
/// 获取temp
#define kPathTemp NSTemporaryDirectory()
/// 获取沙盒 Document
#define kPathDocument [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]
/// 获取沙盒 Cache
#define kPathCache [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]

///  方法输出
#define MyLog__func__ MyLog(@"%s", __func__)

///  自定义日志输出
#ifdef DEBUG
#define MyLog(...) NSLog(__VA_ARGS__);
#else
#define MyLog(...)
#endif

/// 状态栏高度
#define kStatusBarHeight [UIApplication sharedApplication].statusBarFrame.size.height
/// Navigation高度
#define kNaviBarHeight [UINavigationBar appearance].frame.size.height
/// 导航栏高度
#define kTopBarHeight (kStatusBarHeight+kNaviBarHeight)
/// iphoneX TabBar 高度
#define kIphoneXTabBarHeight 83
/// 标签栏高度
#define kTabBarHeight [[UITabBarController alloc]init].tabBar.frame.size.height

/// 根据屏幕尺寸分辨iphone
#define is_iPhoneXS_Max     (ScreenW == 414.f && ScreenH == 896.f)
#define is_iPhoneX          (ScreenW == 375.f && ScreenH == 812.f)
#define is_iPhone8_Plus     (ScreenW == 414.f && ScreenH == 736.f)
#define is_iPhone8          (ScreenW == 375.f && ScreenH == 667.f)
#define is_iPhone5_SE       (ScreenW == 320.f && ScreenH == 568.f)











#endif /* PrefixHeader_pch */
